package cn.lger.icollege.dao;

import cn.lger.icollege.entity.Teacher;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.Query;
import org.springframework.data.repository.query.Param;
import org.springframework.stereotype.Repository;

/**
 * Code that Changed the World
 * Pro said
 * Created by Pro on 2018-04-14.
 */
@Repository
public interface TeacherDao extends JpaRepository<Teacher, String> {


    @Query("select t.news from Teacher t where t.username = :username")
    Integer findNewsNumByUsername(@Param("username") String username);
}
